PCIe is divided into three main protocol layers, plus the device core at the top.
Each layer has a transmit path (TX) and a receive path (RX), and they work independently.
This means a device can send and receive data at the same time (full-duplex).
PCIe Device Layers.png


1️⃣ Device Core & Interface


2️⃣ Transaction Layer (TL)



4️⃣ Physical Layer


🧠 Why Layers Matter


📊 Quick Summary Table

Layer Main Job Key Output
Device Core Implements device function & config space Requests to TL
Transaction Creates TLPs, handles ordering/QoS/flow TLPs
Data Link Ensures reliable delivery (Ack/Nak) DLLPs + TLPs
Physical Serializes, encodes, transmits bits Serial data stream

Key Point: Every PCIe Interface Implements All Layers

Even if a device only forwards traffic (like a switch port), it still must have:

So yes — switches implement all three layers per port.
Each port is basically its own PCIe endpoint/bridge, with its own state machine, buffers, and flow control logic.